home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
comm
/
net
/
dnet_src.lha
/
dnet
/
amiga
/
lib
/
dread.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-11-05
|
446b
|
36 lines
/*
* DRead.C
*/
#include "lib.h"
long
DRead(_chan, _buf, bytes)
void *_buf;
void *_chan;
long bytes;
{
CHANN *chan = (CHANN *)_chan;
char *buf = (char *)_buf;
long len = 0;
long n = -1;
if (chan->eof)
return(-1);
while (bytes) {
if (n == 0)
WaitPort(&chan->port);
n = DNRead(chan, buf, bytes);
if (n < 0)
break;
len += n;
buf += n;
bytes -= n;
if (chan->eof)
break;
}
return(len);
}